package com.haihu.nx.supervision.common.auth.encoding;

import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author 作者 luqiantu
 * md5盐值比对
 */
import com.haihu.nx.supervision.common.util.MD5Util;

public class MD5PasswordEncoder implements PasswordEncoder {

	@Override
	public String encode(CharSequence rawPassword) {
		return MD5Util.encode(String.valueOf(rawPassword));
	}

	@Override
	public boolean matches(CharSequence rawPassword, String encodedPassword) {
		return MD5Util.verify(String.valueOf(rawPassword), encodedPassword) ;
	}

}
